#NoTrayIcon
#Region ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
#PRE_Icon=ico.ico
#PRE_Outfile=IP设置工具2021.exe
#PRE_UseX64=n
#PRE_Res_Fileversion=0.0.0.0
#PRE_Res_Fileversion_AutoIncrement=y
#PRE_Res_Language=2052
#PRE_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** 由 AccAu3Wrapper_GUI 创建指令 ****

#Region ;**** 参数创建于 ACNWrapper_GUI ****
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Clipboard.au3>
;~ #include <array.au3>
#include <ComboConstants.au3>
#include <GuiIPAddress.au3>
#include <Misc.au3>
#include <TrayConstants.au3>
#include <SendMessage.au3>
#include "inc/gl.au3" ;全局变量
#include "inc/ipmacdncskcom.au3" ;获取mac ip

ToolTip("")

;~ TEST1();测试 无效
_GetIP() ;获取公网IP
#Region

#EndRegion

#Region 开始-IP地址处理


Opt("TrayMenuMode", 3) ;扩展脚本的托盘图标/菜单性能. 可以是以下值的组合.    1 = 没有默认菜单    2 = 如果点击用户创建的选中项目, 不会自动取消选中状态
$Exit = TrayCreateItem("退 出")
TraySetState()
TraySetClick(16) ;设置托盘(显示托盘菜单)的点击模式 释放鼠标右键(显示托盘菜单)
TraySetToolTip("IP设置工具")

;====================================================================================================================
;UI开始

$Form1 = GUICreate("IP地址设置工具111", 434, 600, -1, -1, $ws_popup) ;创建 GUI 窗口
GUISetBkColor(0xABCDEF) ;设置 GUI 窗口背景颜色.


Global $wangka1, $lianjie1, $mac1, $id, $zhuangtai, $computer, $DNS1, $DNS2, $IP, $MAST, $GATEWAY, $dhcpserver
Global $ss, $lianjie, $mac, $Input7, $Input77, $pan, $arrayIp, $net, $jushu1, $jushu2, $jushu3, $jushu4, $jish, $you = 0, $er = 0
Global $zhongpan = 0, $tianjia = 0, $jiancha = 0, $tianjia1 = 0, $panwmi = 0, $tianjia2 = 0, $tianjia3 = 0
Global $gaoji = 0, $putong = 0, $jisuan = 0, $jisuan1 = 2, $xianshi = 1
Local $oClassSet, $oClass, $oLocator
Local $oService, $sMesStr

WMI()
;~ _ArrayDisplay($mac1)

If UBound($wangka1) > 1 Then
	$pan = 1
ElseIf UBound($wangka1) = 1 Then
	$pan = 0
Else
	$pan = 3
EndIf

;标题栏
$Label0 = GUICtrlCreateLabel('   IP 地址设置工具11', 0, 0, 400, 30, $SS_CENTER + $SS_CENTERIMAGE, $GUI_WS_EX_PARENTDRAG) ;创建静态标记(Label)控件.
GUICtrlSetColor(-1, 0xEFEFEF) ;设置控件的文本颜色.
GUICtrlSetFont(-1, 14, 400, 0, 'Verdana') ;设置控件的字体.
$s = 29
;关闭按钮
$Label000 = GUICtrlCreateLabel('×', 400, -7, 40, 37) ;f3拷贝的
GUICtrlSetColor(-1, 0xEFEFEF) ;设置控件的文本颜色.
GUICtrlSetFont(-1, 24, 400, 0, 'Verdana') ;设置控件的字体.
;方框
$Label12 = GUICtrlCreateLabel("", 0, 30, 2, 269) ;左匡
$Label13 = GUICtrlCreateLabel("", 430, 32, 2, 269) ;右框
$Label14 = GUICtrlCreateLabel("", 0, 298, 434, 2) ;下框
Global $Group00, $Group1

;------------------------------------------------------------------------第一部分 本地网卡信息------------------------------------------------------------------------
$Group0 = GUICtrlCreateLabel("", 8, 8 + $s, 417, 17) ;本地网卡信息的小背景
$Group00 = GUICtrlCreateLabel("本地网卡信息", 8, 11 + $s, 417, 15, $SS_CENTER)

;具体内容
$Input7 = GUICtrlCreateCombo("", 96 + 20, 32 + $s, 265, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL), $WS_EX_TRANSPARENT) ;网卡下拉框 短
;$Input7 = GUICtrlCreateCombo("777777777", 96, 32 + $s, 313, 21, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL), $WS_EX_TRANSPARENT);网卡下拉框 长
$Group1 = GUICtrlCreateLabel("", 9, 25 + $s, 415, 82) ;本地网卡信息的大背景
$Label7 = GUICtrlCreateLabel("本地网卡：", 32 + 20, 37 + $s, 64, 17)
$Label8 = GUICtrlCreateLabel("连接名称：", 32 + 20, 61 + $s, 64, 17)
$Label9 = GUICtrlCreateLabel("MAC 地址：", 32 + 20, 85 + $s, 66, 17)
$Label10 = GUICtrlCreateLabel("", 102 + 20, 61 + $s, 265, 17) ;连接名称
$Label11 = GUICtrlCreateLabel("", 102 + 20, 85 + $s, 265, 17) ;;mac地址
$Label09 = GUICtrlCreateLabel("12-34-56-78-45-as-df", 102 + 175, 85 + $s, 80, 15) ;真实mac地址
;$Label7 = GUICtrlCreateLabel("本地网卡：", 32, 37 + $s, 64, 17)
;$Label8 = GUICtrlCreateLabel("连接名称：", 32, 61 + $s, 64, 17)
;$Label9 = GUICtrlCreateLabel("MAC 地址：", 32, 85 + $s, 66, 17)
;$Label10 = GUICtrlCreateLabel("33333", 96, 61 + $s, 266, 17);连接名称
;$Label11 = GUICtrlCreateLabel("44444", 96, 85 + $s, 274, 17);MAC 地址
GUICtrlSetBkColor($Label0, 0x605f99) ;设置控件的背景颜色.
GUICtrlSetBkColor($Label000, 0x605f99) ;设置控件的背景颜色.
GUICtrlSetBkColor($Label12, 0x00B2EE) ;方框左匡
GUICtrlSetBkColor($Label13, 0x00B2EE) ;方框右框
GUICtrlSetBkColor($Label14, 0x00B2EE) ;方框 下框
GUICtrlSetBkColor($Group0, 0x00B2EE) ;;本地网卡信息的小背景
GUICtrlSetBkColor($Group00, 0x00B2EE) ;中间条
GUICtrlSetBkColor($Group1, 0xD1EEEE) ;本地网卡信息 大背景
GUICtrlSetBkColor($Input7, 0xD1EEEE) ;网卡下拉框
GUICtrlSetBkColor($Label7, 0xD1EEEE)
GUICtrlSetBkColor($Label8, 0xD1EEEE) ;连接名称
GUICtrlSetBkColor($Label9, 0xD1EEEE) ;mac地址
GUICtrlSetBkColor($Label10, 0xD1EEEE) ;连接名称
GUICtrlSetBkColor($Label11, 0xD1EEEE) ;mac地址
GUICtrlSetBkColor($Label09, 0xD1EEE0) ;真实mac地址

;$pan = 0
If $pan = 0 Then $Input7 = GUICtrlCreateLabel("  " & $wangka1[0], 96, 37 + $s, 313, 17)
GUICtrlSetData($Input7, _ArrayToString($wangka1, "|"), $wangka1[0])
;一个圆角矩形框
$ico2 = GUICtrlCreateIcon(@TempDir & "\hou.ico", 2, 9, 0, 35, 30)
$group = GUICtrlCreateGroup("", 42, 52, 350, 80) ;创建组框(Group)控件.
;分割线
$zhong = GUICtrlCreateLabel("", 8, 103 + $s + 5, 417, 6)

;------------------------------------------------------------------------第二部分------------------------------------------------------------------------
$Group2 = GUICtrlCreateLabel("", 8, 109 + $s + 5, 417, 17, $SS_CENTER)
$Group22 = GUICtrlCreateLabel("当前计算机配置信息", 8, 117 + $s, 417, 13, $SS_CENTER) ;上面的横条
;$Group33 = GUICtrlCreateLabel("", 8, 117 + $s, 417, 113);中间大背景 大
$Group11 = GUICtrlCreateLabel("", 9, 126 + $s + 5, 415, 98) ;中间大块背景 小
;~ GUICtrlSetState($Group11, 32) ;隐藏背景,修改IP
$Input1 = _GUICtrlIpAddress_Create($Form1, 96, 131 + $s + 5, 106, 21, $WS_EX_STATICEDGE + $WS_EX_LAYERED) ;ip
$Input2 = _GUICtrlIpAddress_Create($Form1, 96, 163 + $s + 5, 106, 21) ;子网掩码
$Input3 = _GUICtrlIpAddress_Create($Form1, 96, 195 + $s + 5, 106, 21) ;默认网关
$Input4 = _GUICtrlIpAddress_Create($Form1, 304, 163 + $s + 5, 106, 21) ;,首选 DNS
$Input5 = _GUICtrlIpAddress_Create($Form1, 304, 195 + $s + 5, 106, 21) ;,$WS_EX_TRANSPARENT)
$Input6 = GUICtrlCreateInput("", 304, 131 + $s + 5, 106, 21, $SS_CENTER + $SS_CENTERIMAGE) ;,$WS_EX_TRANSPARENT)
$Label1 = GUICtrlCreateLabel(" IP 地址：", 32, 136 + $s + 5, 64, 17)
$Label2 = GUICtrlCreateLabel("子网掩码：", 32, 168 + $s + 5, 64, 17)
$Label3 = GUICtrlCreateLabel("默认网关：", 32, 200 + $s + 5, 64, 17)
$Label4 = GUICtrlCreateLabel(" 首选 DNS ：", 224, 168 + $s + 5, 72, 17)
$Label5 = GUICtrlCreateLabel(" 备用 DNS ：", 224, 200 + $s + 5, 72, 17)
$Label6 = GUICtrlCreateLabel(" 配置名称 ：", 224, 136 + $s + 5, 72, 17) ;在哪?
$Label6 = GUICtrlCreateLabel("计算机名称：", 218, 136 + $s + 5, 85, 17)

;~ $ico = GUICtrlCreateIcon(@TempDir & "\line.ico", 2, 9, 3, 24, 24)
GUICtrlSetBkColor($Group2, 0x00B2Ee) ;
GUICtrlSetBkColor($Group22, 0x00B2EE) ;
GUICtrlSetBkColor($Group11, 0xD1EEEE)


$di = 0 ;GUICtrlCreateLabel("", 8, 267, 417, 20, $SS_CENTER + $SS_CENTERIMAGE) ;下条
;~ GUICtrlSetBkColor($di, 0x00B2EE) ;0x9AC0CD);中间条
;中间条上的按钮
$button1 = GUICtrlCreateButton("转为DHCP", 16 + 5, 267, 70, 20, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0x00B2EE) ;设置控件的背景颜色.
$button22 = GUICtrlCreateButton("确认修改", 120 + 5, 267, 70, 20, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0x00B2EE)
$button2 = GUICtrlCreateButton("修改IP", 120 + 5, 267, 70, 20, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0x00B2EE)
$button3 = GUICtrlCreateButton("设置", 232 + 5, 267, 70, 20, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0x00B2EE) ;设置控件的背景颜色.
$button4 = GUICtrlCreateButton("上传配置", 336 + 5, 267, 70, 20, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0x00B2EE)
GUICtrlSetState($button22, 32) ;隐藏确认
;~ $button7 = GUICtrlCreateButton("添加配置", 16 + 5, 297, 70, 20, -1, $WS_EX_TRANSPARENT)
;~ GUICtrlSetBkColor(-1, 0x00B2EE)
;~ $button5 = GUICtrlCreateButton("保存", 120 + 5, 297, 70, 20, -1, $WS_EX_TRANSPARENT);2
;~ GUICtrlSetBkColor(-1, 0x00B2EE)
;~ $button6 = GUICtrlCreateButton("退出", 232 + 5, 297, 70, 20, -1, $WS_EX_TRANSPARENT);2
;~ GUICtrlSetBkColor(-1, 0x00B2EE)
;~ $button8 = GUICtrlCreateButton("应用配置", 336 + 5, 297, 70, 20, -1, $WS_EX_TRANSPARENT)
;~ GUICtrlSetBkColor(-1, 0x00B2EE)
;~ ;-------------------------------------------------------------------------------------------------------------------------------------------------
;~ ;中间条多余的按钮

;用于显示即时信息的默认隐藏 ;如果网卡被禁用后的显示信息
$xinxi = GUICtrlCreateLabel("", 20, 118, 393, 123, $SS_CENTER) ;网卡禁用,打叉 提示框
GUICtrlSetFont(-1, 16) ;设置控件的字体.
GUICtrlSetBkColor(-1, 0xD1EEEE) ;设置控件的背景颜色.
GUICtrlSetColor(-1, 0xCD2626) ;设置控件的文本颜色.
GUICtrlSetState(-1, $gui_hide) ;调整控件状态.隐藏控件
;------------------------------------------------------------------------------------------------------------------------------------------------
;~ ;多余的控件
;~  ;未知  第二部分的标题未知
;~ $s=-117
;~ $2checkbox5 = GUICtrlCreateCheckbox("  计算机名称", 260, 395, 120, 20)

;~ ;挡住标题栏 为什么?
;~ $2Labelaa = GUICtrlCreateLabel('', 0, 0, 400, 30, $SS_CENTER + $SS_CENTERIMAGE);, $GUI_WS_EX_PARENTDRAG)=============================================================
;高级设置 位于第一部分 已经不需要
;~ $checkbox6 = GUICtrlCreateCheckbox("   CS-KEY", 260, 110, 120, 20)
;~ $2Group44 = GUICtrlCreateLabel("99999999999999999", 8, 117 + $s, 417, 113)
;~ $2radio1 = GUICtrlCreateRadio("高级应用(多台电脑)", 50, 33, 150, 25)
;~ $2radio2 = GUICtrlCreateRadio("普通应用(个人电脑)", 250, 33, 150, 25)
;~ GUICtrlSetState($group, $gui_hide);隐藏控件
;~ GUICtrlSetState($checkbox6, $gui_hide)
;~ GUICtrlSetState($2radio2, $GUI_CHECKED)
;~ ; GUICtrlSetState($button5, $gui_hide)
;~ ; GUICtrlSetState($button6, $gui_hide)
;~ ; GUICtrlSetState($Label6, $gui_hide)

GUISetState(@SW_SHOW, $Form1)
;~ GUISetState(@SW_SHOW, $form2)
;~ GUISetState(@SW_HIDE, $form3)
;~ GUISetState(@SW_SHOW, $form3)
#EndRegion 开始-IP地址处理

du()
_GetIP() ;获取公网IP
GUICtrlSetData($Label0, $title1) ;标题

#Region 硬件配置信息显示
;-----------------------------------------------------------------------------------------------------------------------
;硬件配置:
$x1 = 22
$y1 = 315
$xx1 = 72
$yy1 = 20
$jj = 22

$x2 = 95
$y2 = 312
$xx2 = 106
$yy2 = 20
$Input201 = GUICtrlCreateInput("", $x2, $y2, $xx2, $yy2)
$y2 = 312 + 6
$xx2 = 106 + 199
$Input202 = GUICtrlCreateLabel("CPU：", $x2, $y2 + $jj * 1, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Input203 = GUICtrlCreateLabel("16+16+16+16", $x2 + 35, $y2 + $jj * 2, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Input204 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 3, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Input205 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 4, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Input206 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 5, $xx2, $yy2) ;,$WS_EX_TRANSPARENT
$Input207 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 6, $xx2, $yy2) ;,$WS_EX_TRANSPARENT
$Input208 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 7, $xx2, $yy2) ;,$WS_EX_TRANSPARENT
$Input209 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 8, $xx2, $yy2) ;,$WS_EX_TRANSPARENT
$Input210 = GUICtrlCreateLabel("", $x2, $y2 + $jj * 9, $xx2 - 55, $yy2 + 60, $SS_CENTER) ;
$Labe201 = GUICtrlCreateLabel("部门/姓名：", $x1, $y1, $xx1, $yy1)
$Labe202 = GUICtrlCreateLabel("处理器型号：", $x1, $y1 + $jj * 1, $xx1, $yy1)
$Labe203 = GUICtrlCreateLabel("容 量(G)    内存：", $x1, $y1 + $jj * 2, $xx1 + 36, $yy1)
$Labe204 = GUICtrlCreateLabel("机器型号：", $x1, $y1 + $jj * 3, $xx1, $yy1)
$Labe205 = GUICtrlCreateLabel("主板型号", $x1, $y1 + $jj * 4, $xx1, $yy1)
$Labe206 = GUICtrlCreateLabel("固件版本：", $x1, $y1 + $jj * 5, $xx1, $yy1)
$Labe207 = GUICtrlCreateLabel("内存型号：", $x1, $y1 + $jj * 6, $xx1, $yy1)
$Labe208 = GUICtrlCreateLabel("内存频率：", $x1, $y1 + $jj * 7, $xx1, $yy1)
$Labe209 = GUICtrlCreateLabel("内存极限：", $x1, $y1 + $jj * 8, $xx1, $yy1)
$Labe210 = GUICtrlCreateLabel("硬盘信息：", $x1, $y1 + $jj * 9 + 10, $xx1, $yy1 * 2)
$x1 = 234
$Labe301 = GUICtrlCreateLabel("金阳光编号：", $x1, $y1, $xx1, $yy1)
$Labe303 = GUICtrlCreateLabel("硬盘：", $x1 - 20, $y1 + $jj * 2, $xx1, $yy1)
$Labe306 = GUICtrlCreateLabel("  序列号：", $x1 - 35, $y1 + $jj * 5, $xx1, $yy1)
$x2 = 312
$y2 = 312 + 6
$Input301 = GUICtrlCreateInput("", $x2, $y2, $xx2 - 200, $yy2)
$Input303 = GUICtrlCreateLabel("", $x2 - 50, $y2 + $jj * 2, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Input306 = GUICtrlCreateLabel("", $x2 - 50, $y2 + $jj * 5, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Input309 = GUICtrlCreateLabel("", $x1 - 20, $y2 + $jj * 8, $xx2, $yy2) ;,$WS_EX_TRANSPARENT)
$Labe310 = GUICtrlCreateLabel("0.0.0.0", 330, 580, 90, 15) ;外网IP
#EndRegion 硬件配置信息显示
GUICtrlSetData($Labe310, $gip) ;更新外网IP显示
GUICtrlSetData($Label0, $title1) ;标题
_xiamian()
_duid()
While 1
	$nMsg = GUIGetMsg(1)
	$TrayGetMsg = TrayGetMsg()
	
	Switch $TrayGetMsg
		Case $Exit
			FileDelete(@TempDir & "\hou.ico")
			FileDelete(@TempDir & "\noline.ico")
			FileDelete(@TempDir & "\line.ico")
			Exit
		Case $TRAY_EVENT_PRIMARYDOUBLE
;~ 			xianshi()
	EndSwitch
	
	Switch $nMsg[0]
;~ 		Case $Labelaa
;~ 			_SendMessage($Form1, $WM_NCLBUTTONDOWN, $HTCAPTION, 0)
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Label000

		Case $GUI_EVENT_SECONDARYDOWN ;
			ToolTip("鼠标右键按下.")
		Case $GUI_EVENT_SECONDARYUP ;
			ToolTip("鼠标右键释放.")
			
		Case $Input7 ;更新网卡信息
			du()
			_duid()
			
		Case $button1 ;DHCP
			_dhcp()
		Case $button2 ;修改IP
			ToolTip("修改完成请点击确认修改")
			GUICtrlSetState($Group11, 32) ;隐藏背景,修改IP
			GUICtrlSetBkColor($Label1, 0xABCDEF)
			GUICtrlSetBkColor($Label2, 0xABCDEF)
			GUICtrlSetBkColor($Label3, 0xABCDEF)
			GUICtrlSetBkColor($Label4, 0xABCDEF)
			GUICtrlSetBkColor($Label5, 0xABCDEF)
			GUICtrlSetBkColor($Label6, 0xABCDEF)
			GUICtrlSetState($button2, 32)
			GUICtrlSetState($button22, 16)
			
		Case $button22 ;确认修改
			ToolTip("修改完成请点击确认修改")
			GUICtrlSetState($Group11, 32) ;隐藏背景,修改IP
			GUICtrlSetBkColor($Label1, 0xABCDEF)
			GUICtrlSetBkColor($Label2, 0xABCDEF)
			GUICtrlSetBkColor($Label3, 0xABCDEF)
			GUICtrlSetBkColor($Label4, 0xABCDEF)
			GUICtrlSetBkColor($Label5, 0xABCDEF)
			GUICtrlSetBkColor($Label6, 0xABCDEF)
			GUICtrlSetState($button2, 16) ;显示 修改
			GUICtrlSetState($button22, 32) ;隐藏确认
			_xiugaiip()
			
		Case $button3 ;
			ToolTip("功能开发中...")
			_GetIP()
			GUICtrlSetData($Labe310, $gip) ;更新外网IP显示
			GUICtrlSetData($Label0, $title1) ;标题
		Case $button4 ;
			_add()
			
			
	EndSwitch

	#cs
		Switch $nMsg[0]
		;~ 		Case $Labelaa
		;~ 			_SendMessage($Form1, $WM_NCLBUTTONDOWN, $HTCAPTION, 0)
		Case $GUI_EVENT_CLOSE
		Exit
		Case $Label000
		FileDelete(@TempDir & "\hou.ico")
		FileDelete(@TempDir & "\noline.ico")
		FileDelete(@TempDir & "\line.ico")
		Exit

		Case  $GUI_EVENT_SECONDARYDOWN;
		ToolTip("鼠标右键按下.")
		Case  $GUI_EVENT_SECONDARYUP;
		ToolTip("鼠标右键释放.")
		;~ 		Case $button1 ;DHCP
		;自动获取IP地址
		;~ 			MsgBox(0,0,StringStripWS(GUICtrlRead($Label11),1 ))
		If StringInStr(GUICtrlRead($Group22), "DHCP") = 0 Then
		GUICtrlSetData($Group22, "正在修改DHCP配置信息，请稍等。。。")

		$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
		$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", 0x10 + 0x20)
		For $objItem In $colItems
		;"网卡名：" & $objItem.Description & "”" & @CRLF & _
		If @error Then ExitLoop
		;~ 					If $objItem.MACAddress == StringStripWS(GUICtrlRead($Label11), 1) Then
		$objItem.EnableDHCP()
		$objItem.SetDNSServerSearchOrder()
		;~ 					EndIf

		Next
		;;;;;;;;;;;;;;;;;;;;;;;  设置DHCP自动获取  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;$objItem.EnableDHCP
		;$objItem.SetDNSServerSearchOrder()
		;$objItem.ReleaseDHCPLease
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		$objWMIService = ""
		$colItems = ""
		$objItem = ""
		$colItems = ""
		;	RunWait(@ComSpec & ' /c netsh interface ip set address "' & StringStripWS(GUICtrlRead($Label10), 1) & '" source=dhcp', "", @SW_HIDE)
		;	RunWait(@ComSpec & ' /c ipconfig /renew', "", @SW_HIDE)
		MsgBox(64 + 0, "提示", "DCHP自动获取IP设置成功")
		GUICtrlSetData($Group22, "正在刷新配置信息，请稍等。566。。")
		;~ 				WMI()
		Sleep(5000)
		;~ 				du()
		Else
		MsgBox(64 + 0, "提示", "当前已经是DCHP自动获取IP地址，无需再设置！")
		EndIf
		;~ 		Case $button2 ;应用设置
		GUICtrlSetData($Group22, "正在设置当前配置信息，请稍等。。。")
		Dim $SetIPAddress[1]
		;~ 			$SetIPAddress[0] = _GUICtrlIpAddress_Get($Input11) ;IP
		;~ 			$ComputerName = GUICtrlRead($Input66)
		Dim $SetSubnetmask[1]
		;~ 			$SetSubnetmask[0] = _GUICtrlIpAddress_Get($Input22)
		Dim $SetGateway[1]
		;~ 			$SetGateway[0] = _GUICtrlIpAddress_Get($Input33)
		Dim $SetDns[2]
		;~ 			$SetDns[0] = _GUICtrlIpAddress_Get($Input44)
		;MsgBox(0,0,_GUICtrlIpAddress_Get($Input55))
		;~ 			If _GUICtrlIpAddress_Get($Input55) == "0.0.0.0" Then
		;MsgBox(0,0,_GUICtrlIpAddress_Get($Input55))
		;~ 				$SetDns[1] = _GUICtrlIpAddress_Get($Input44)
		;~ 			Else
		;~ 				$SetDns[1] = _GUICtrlIpAddress_Get($Input55)
		;~ 			EndIf
		$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
		$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", 0x10 + 0x20)
		For $objItem In $colItems
		$objItem.EnableStatic($SetIPAddress, $SetSubnetmask)
		$objItem.SetGateways($SetGateway)
		$objItem.SetDNSServerSearchOrder($SetDns)
		Next
		$objWMIService = ""
		$colItems = ""
		$objItem = ""
		$colItems = ""
		;~ 			RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName", "ComputerName", "REG_SZ", $ComputerName)
		;~ 			RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $ComputerName)
		;~ 			RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $ComputerName)
		;~ 			RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $ComputerName)
		RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "VirtualNetworkNumber", "REG_DWORD", '"' & StringRegExpReplace($SetIPAddress[0], ".*\.", "") & '"')
		RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Nwlnkipx\Parameters", "VirtualNetworkNumber", "REG_DWORD", '"' & StringRegExpReplace($SetIPAddress[0], ".*\.", "") & '"')

		;~ 		Case $button3 ;显示窗口 form3
		GUICtrlSetData($Label0, "    高级设置")
		GUICtrlSetData($Group00, "")
		$zhongpan = 1
		$tianjia3 = 0
		;~ 			If $putong = 1 Then  ;peizhi()
		;~ 			GUICtrlSetState($Group44, $gui_show)
		;~ 			GUICtrlSetState($Group44, $GUI_FOCUS)


		;~ 		Case $Label000, $ico2, $button6 ;显示主窗口

		;~ 			GUICtrlSetData($Label0, "   IP 地址设置工具33")
		;~ 			GUICtrlSetData($Group00, "本地网卡信息")
		;~ 			du()
		;~ 			GUISetState(@SW_SHOW, $form2)
		$zhongpan = 0
		$tianjia = 0
		$tianjia2 = 0



		;~ 		Case $button1 ;添加配置信息
		$tianjia = 1
		;~ 			GUICtrlSetData($Group22, "请输入添加的配置信息（每项都要填写）")
		;~ 			GUICtrlSetState($Group44, $gui_hide)
		;~ 			_GUICtrlIpAddress_ClearAddress($Input1)
		;~ 			_GUICtrlIpAddress_ClearAddress($Input2)
		;~ 			_GUICtrlIpAddress_ClearAddress($Input3)
		;~ 			_GUICtrlIpAddress_ClearAddress($Input4)
		;~ 			_GUICtrlIpAddress_ClearAddress($Input5)
		GUICtrlSetData($Input6, "")
		;~ 			_GUICtrlIpAddress_SetFocus($Input1, 0)
		;~ 		Case $button2 ;应用配置信息

		;MsgBox(0, 0, $net)
		$objWMIService = ""
		$colItems = ""
		$objItem = ""
		$colItems = ""

		;~ 				DU()


		Case $Input7 ;选择配置信息
		;~ 			peizhi()

		;~ 		Case $radio1 ;高级应用
		;~ 			GUICtrlSetState($3Label7, $gui_hide)
		;~ 			GUICtrlSetState($3Label8, $gui_hide)
		;~ 			GUICtrlSetState($3Label9, $gui_hide)
		;~ 			GUICtrlSetState($3Label10, $gui_hide)
		;~ 			GUICtrlSetState($3Label11, $gui_hide)
		;~ 			GUICtrlSetState($3Input7, $gui_hide)
		;~ 			GUICtrlSetState($3button1, $gui_hide)
		;~ 			GUICtrlSetState($3button2, $gui_hide)
		;~ 			GUICtrlSetState($3button3, $gui_hide)
		;~ 			GUICtrlSetState($3button4, $gui_hide)
		;~ 			GUICtrlSetState($button5, $gui_show)
		;~ 			GUICtrlSetState($button6, $gui_show)
		;~ 			GUICtrlSetState($3Label6, $gui_hide)
		;~ 			GUICtrlSetState($Label6, $gui_show)
		$tianjia = 1
		;~ 			GUICtrlSetState($Group44, $gui_show)
		;~ 			GUICtrlSetState($Group44, $GUI_FOCUS)
		$tianjia1 = 0
		$tianjia3 = 0
		$tianjia = 1
		;~ 			GUICtrlSetState($group, $gui_show)
		;		GUICtrlSetState($checkbox6, $gui_show)
		;~ 			GUICtrlSetData($Group22, "当前配置信息，如需修改请按一下鼠标中键！")
		$gaoji = 1
		$putong = 0
		;~ 		Case $radio2 ;普通应用
		;~ 			GUICtrlSetState($Label7, $gui_show)
		;~ 			GUICtrlSetState($Label8, $gui_show)
		;~ 			GUICtrlSetState($Label9, $gui_show)
		;~ 			GUICtrlSetState($Label10, $gui_show)
		;~ 			GUICtrlSetState($Label11, $gui_show)
		GUICtrlSetState($Input7, $gui_show)
		;~ 			GUICtrlSetState($3button5, $gui_hide)
		;~ 			GUICtrlSetState($33Label6, $gui_hide)
		;~ 			GUICtrlSetState($Label6, $gui_show)
		;~ 			GUICtrlSetState($button6, $gui_show)
		;~ 			GUICtrlSetState($button1, $gui_show)
		;~ 			GUICtrlSetState($button2, $gui_show)
		;~ 			GUICtrlSetState($button3, $gui_show)
		;~ 			GUICtrlSetState($3button6, $gui_hide)
		;~ 			GUICtrlSetState($button4, $gui_show)
		$tianjia = 0
		$tianjia2 = 0
		;~ 			GUICtrlSetState($Group44, $gui_show)
		;~ 			GUICtrlSetState($Group44, $GUI_FOCUS)
		;~ 			GUICtrlSetState($group, $gui_hide)
		;~ 			GUICtrlSetState($checkbox1, $gui_hide)
		;~ 			GUICtrlSetState($checkbox2, $gui_hide)
		;~ 			GUICtrlSetState($checkbox3, $gui_hide)
		;~ 			GUICtrlSetState($checkbox4, $gui_hide)
		;~ 			GUICtrlSetState($checkbox5, $gui_hide)
		;	GUICtrlSetState($checkbox6, $gui_hide)
		$putong = 1
		$gaoji = 0

		EndSwitch
	#ce
WEnd
;------------------------------------------IP地址本地部分开始-------------------------------------------------------------------------
Func _hardread($sec, $key, $num)
	$ini1 = @TempDir & "\dncskcom\" ;
	$ini2 = @ComputerName & "config.ini"
	$inia = $ini1 & $ini2
	$bb = IniRead($inia, $sec & "1", $key, "")
	For $j = 2 To 10
		$aa = IniRead($inia, $sec & $j, $key, "")
		If $num Then $aa = StringLeft($aa, $num)
		If $aa = "" Then ExitLoop
		$bb = $bb & "+" & $aa
	Next
;~ 	 $bb=StringReplace ( StringReplace (  StringReplace ( StringReplace ( $bb, "SCSI", "" ), "Disk", "" ), "Device", "" ), " ", "" )
;~
	Return $bb
EndFunc   ;==>_hardread

Func _hardread1($sec, $key, $num)
	$bb = IniRead(@ScriptDir & "\config\2\" & @ComputerName & ".ini", $sec & "1", $key, "")
	For $j = 2 To 10
		$aa = IniRead(@ScriptDir & "\config\2\" & @ComputerName & ".ini", $sec & $j, $key, "")
		If $num Then $aa = StringLeft($aa, $num)
		
		If $aa = "" Then ExitLoop
		$bb = $bb & "+" & $aa
	Next
	$bb = StringReplace(StringReplace(StringReplace(StringReplace($bb, "SCSI", ""), "Disk", ""), "Device", ""), " ", "")
;~ 	MsgBox(0,$key,$bb)
EndFunc   ;==>_hardread1
Func _xiamian() ;读完更新下面的信息;分为两部分 硬件部分和变量部分
	$a1 = "Win32_DiskDrive"
	$a2 = "$object.Model"
	$a = _hardread($a1, $a2, 99)
;~ 	GUICtrlSetData ( $Input202, _hardread("Win32_Processor","$object.Name",99) );cpu
;~ 	GUICtrlSetData ( $Input203, _hardread("Win32_Processor","$object.ProcessorId",99) );cpuid
;~ 	GUICtrlSetData ( $Input203, _hardread("Win32_PhysicalMemory","$object.Capacity",99) ); 内存容量
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_PhysicalMemory","$object.Speed",99) ); 内存频率
;~ 	GUICtrlSetData ( $Input206, _hardread("Win32_PhysicalMemory","$object.SerialNumber",99) ); 内存sn
;~ 	GUICtrlSetData ( $Input207, _hardread("Win32_PhysicalMemory","$object.PartNumber",99) ); 内存型号
;~ 	GUICtrlSetData ( $Input208, _hardread("Win32_ComputerSystem","$object.Manufacturer",99) ); ;计算机制造商的名称。
;~ 	GUICtrlSetData ( $Input209, _hardread("Win32_ComputerSystem","$object.Model",99) ); 机器型号?
;~ 	GUICtrlSetData ( $Input210, _hardread("Win32_BIOS","$object.ReleaseDate",99) ); bios日期
;~ 	GUICtrlSetData ( $Input211, _hardread("Win32_BIOS","$object.SerialNumber",99) ); bios序列号
;~ 	GUICtrlSetData ( $Input212, _hardread("Win32_PhysicalMemoryArray","$object.Location",99) ); ;内存阵列的物理位置。
;~ 	GUICtrlSetData ( $Input213, _hardread("Win32_PhysicalMemoryArray","$object.MemoryDevices",99) ); 此内存阵列中可用的物理插槽或插槽数。
;~ 	GUICtrlSetData ( $Input204, _hardread("Win32_PhysicalMemoryArray","$object.MaxCapacity",99) ); ;此特定内存数组可安装的最大内存大小（字节）。
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_BaseBoard","$object.Manufacturer",99) ); 主板生产厂家
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_BaseBoard","$object.Product",99) ); 主板型号
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_BaseBoard","$object.SerialNumber",99) ); 主板序列号
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_ComputerSystemProduct","$object.Name",99) ); 机器型号
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_ComputerSystemProduct","$object.IdentifyingNumber",99) ); 机器序列号
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_ComputerSystemProduct","$object.Vendor",99) ); 机器厂商
;~ 	 GUICtrlSetData ( $Input205, _hardread("Win32_DiskDrive","$object.Size",99) ); 硬盘大小
;~ 	GUICtrlSetData ( $Input204, _hardread("Win32_DiskDrive","$object.Model",99) ); 硬盘型号
;~ 	GUICtrlSetData ( $Input206, _hardread("Win32_DiskDrive","$object.MediaType",99) ); 硬盘类型
	
;~ 	GUICtrlSetData ( $Input203, _hardread("Win32_Processor","$object.ProcessorId",99) );cpuid
;~ 	GUICtrlSetData ( $Input206, _hardread("Win32_PhysicalMemory","$object.SerialNumber",99) ); 内存sn
;~ 	GUICtrlSetData ( $Input208, _hardread("Win32_ComputerSystem","$object.Manufacturer",99) ); ;计算机制造商的名称。
;~ 	GUICtrlSetData ( $Input209, _hardread("Win32_ComputerSystem","$object.Model",99) ); 机器型号?
;~ 	GUICtrlSetData ( $Input211, _hardread("Win32_BIOS","$object.SerialNumber",99) ); bios序列号
;~ 	GUICtrlSetData ( $Input212, _hardread("Win32_PhysicalMemoryArray","$object.Location",99) ); ;内存阵列的物理位置。
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_BaseBoard","$object.Manufacturer",99) ); 主板生产厂家
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_BaseBoard","$object.SerialNumber",99) ); 主板序列号
;~ 	GUICtrlSetData ( $Input205, _hardread("Win32_ComputerSystemProduct","$object.Vendor",99) ); 机器厂商
;~ 	GUICtrlSetData ( $Input206, _hardread("Win32_DiskDrive","$object.MediaType",99) ); 硬盘类型
	
	GUICtrlSetData($Input202, _hardread("Win32_Processor", "$object.Name", 99)) ;cpu
	GUICtrlSetData($Input203, _hardread("Win32_PhysicalMemory", "$object.Capacity", 99)) ; 内存容量
	GUICtrlSetData($Input303, _hardread("Win32_DiskDrive", "$object.Size", 99)) ; 硬盘大小
	GUICtrlSetData($Input204, _hardread("Win32_ComputerSystemProduct", "$object.Name", 99)) ; 机器型号
	GUICtrlSetData($Input205, _hardread("Win32_BaseBoard", "$object.Product", 99)) ; 主板型号
	GUICtrlSetData($Input206, _hardread("Win32_BIOS", "$object.ReleaseDate", 99)) ; bios日期
	GUICtrlSetData($Input306, _hardread("Win32_ComputerSystemProduct", "$object.IdentifyingNumber", 99)) ; 机器序列号
	GUICtrlSetData($Input207, _hardread("Win32_PhysicalMemory", "$object.PartNumber", 99)) ; 内存型号
	GUICtrlSetData($Input208, _hardread("Win32_PhysicalMemory", "$object.Speed", 99)) ; 内存频率
	GUICtrlSetData($Input309, "插槽数量:" & _hardread("Win32_PhysicalMemoryArray", "$object.MemoryDevices", 99)) ; 此内存阵列中可用的物理插槽或插槽数。
	GUICtrlSetData($Input209, _hardread("Win32_PhysicalMemoryArray", "$object.MaxCapacity", 99) & "G") ; ;此特定内存数组可安装的最大内存大小（字节）。

	GUICtrlSetData($Input210, StringReplace(_hardread("Win32_DiskDrive", "$object.Model", 0), " SCSI Disk Device", "")) ; 硬盘型号


;~ 	MsgBox(0,$a1,$a)
EndFunc   ;==>_xiamian

Func _xiugaiip()
	GUICtrlSetData($Group22, "正在设置当前配置信息，请稍等。。。514")
	Dim $SetIPAddress[1]
	$SetIPAddress[0] = _GUICtrlIpAddress_Get($Input1) ;IP
	$ComputerName = GUICtrlRead($Input6)
	Dim $SetSubnetmask[1]
	$SetSubnetmask[0] = _GUICtrlIpAddress_Get($Input2)
	Dim $SetGateway[1]
	$SetGateway[0] = _GUICtrlIpAddress_Get($Input3)
	Dim $SetDns[2]
	$SetDns[0] = _GUICtrlIpAddress_Get($Input4)
	;MsgBox(0,0,_GUICtrlIpAddress_Get($Input55))
	If _GUICtrlIpAddress_Get($Input5) == "0.0.0.0" Then
		;MsgBox(0,0,_GUICtrlIpAddress_Get($Input55))
		$SetDns[1] = _GUICtrlIpAddress_Get($Input4)
	Else
		$SetDns[1] = _GUICtrlIpAddress_Get($Input5)
	EndIf
	$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
	$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", 0x10 + 0x20)
	For $objItem In $colItems
		$objItem.EnableStatic($SetIPAddress, $SetSubnetmask)
		$objItem.SetGateways($SetGateway)
		$objItem.SetDNSServerSearchOrder($SetDns)
	Next
	$objWMIService = ""
	$colItems = ""
	$objItem = ""
	$colItems = ""
	RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName", "ComputerName", "REG_SZ", $ComputerName)
	RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName", "ComputerName", "REG_SZ", $ComputerName)
	RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "NV Hostname", "REG_SZ", $ComputerName)
	RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "Hostname", "REG_SZ", $ComputerName)
	RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters", "VirtualNetworkNumber", "REG_DWORD", '"' & StringRegExpReplace($SetIPAddress[0], ".*\.", "") & '"')
	RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Nwlnkipx\Parameters", "VirtualNetworkNumber", "REG_DWORD", '"' & StringRegExpReplace($SetIPAddress[0], ".*\.", "") & '"')
	If IniRead(@ScriptDir & "\ipconfig.db", "ipconfig", "删除程序自身", "") = 1 Then
		If IniRead(@ScriptDir & "\ipconfig.db", "ipconfig", "自动重启电脑", "") = 1 Then
			$chongqi = "shutdown.exe -r -t 0"
		Else
			$chongqi = ""
		EndIf
		FileDelete(@ScriptDir & "\MAC地址.ini")
		FileDelete(@TempDir & "\hou.ico")
		FileDelete(@TempDir & "\noline.ico")
		FileDelete(@TempDir & "\line.ico")
		FileDelete(@ScriptDir & "\localip.db")
		FileDelete(@ScriptDir & "\ipconfig.db")
		Exit (Run('cmd /c ping 127.0.0.1 -n 2 & taskkill /f /pid "' & @AutoItPID & '"& del /q/f/a "' & @ScriptFullPath & '"& ' & $chongqi, '', @SW_HIDE))
	ElseIf IniRead(@ScriptDir & "\ipconfig.db", "ipconfig", "自动重启电脑", "") = 1 Then
		FileDelete(@TempDir & "\hou.ico")
		FileDelete(@TempDir & "\noline.ico")
		FileDelete(@TempDir & "\line.ico")
		FileDelete(@ScriptDir & "\localip.db")
		FileDelete(@ScriptDir & "\ipconfig.db")
		Run('cmd /c shutdown.exe -r -t 0', '', @SW_HIDE)
	Else
		GUICtrlSetData($Group22, "正在刷新配置信息，请稍等。。。")
		WMI()
		Sleep(5000)
		du()
	EndIf

EndFunc   ;==>_xiugaiip
Func du()
	
	GUICtrlSetData($Input6, @ComputerName)
	GUICtrlSetState($button2, 16) ;显示 修改
	GUICtrlSetState($button22, 32) ;隐藏确认
	GUICtrlSetBkColor($Label1, 0xD1EEEE)
	GUICtrlSetBkColor($Label2, 0xD1EEEE)
	GUICtrlSetBkColor($Label3, 0xD1EEEE)
	GUICtrlSetBkColor($Label4, 0xD1EEEE)
	GUICtrlSetBkColor($Label5, 0xD1EEEE)
	GUICtrlSetBkColor($Label6, 0xD1EEEE)
	If $pan = 1 Then
		GUICtrlSetState($Group11, $GUI_FOCUS) ;调整控件状态.
		GUICtrlSetState($Group11, $gui_show)
		$you = 0
		$sComboRead = GUICtrlRead($Input7) ;读取控件的状态或数据.网卡下拉框
		For $i = 0 To UBound($wangka1) - 1 ;下拉网卡名称
			For $o = 0 To UBound($mac) - 1
				If $sComboRead == $wangka1[$i] Then ;到这里可以确定下拉的网卡序号$I
					GUICtrlSetData($Label10, "  " & $lianjie1[$i]) ;显示本地连接字样
					If StringTrimLeft($mac1[$i], 1) = "" Then ;没有MAC地址 网卡禁用
;~ 						yin()
						;============================================================================================
						_GUICtrlIpAddress_ClearAddress($Input1) ;先把ip地址框清空
						_GUICtrlIpAddress_ClearAddress($Input2)
						_GUICtrlIpAddress_ClearAddress($Input3)
						_GUICtrlIpAddress_ClearAddress($Input4)
						_GUICtrlIpAddress_ClearAddress($Input5)
						;============================================================================================
						GUICtrlSetData($Label11, "  " & StringTrimLeft($mac1[$i], 1))
						GUICtrlSetData($xinxi, "当前网卡被禁用704")
;~ 						GUICtrlSetState($xinxi, $gui_show)
						GUICtrlSetColor($Label10, 0x808080) ;本地连接 灰色
						GUICtrlSetColor($xinxi, 0x808080)
						GUICtrlSetState($button1, $GUI_DISABLE) ;影藏按钮
						GUICtrlSetState($button2, $GUI_DISABLE)
						GUICtrlSetState($button3, $GUI_DISABLE)
						GUICtrlSetState($button4, $GUI_DISABLE)
;~ 						GUICtrlSetData($Group22, "当前计算机配置信息")
					Else ;有MAC地址
						GUICtrlSetColor($Label10, 0x000000) ;;恢复本地连接 黑色
						GUICtrlSetState($xinxi, $gui_hide)
						GUICtrlSetData($Label11, "  " & StringTrimLeft($mac1[$i], 1)) ;mac地址
;~ 						xian()
						GUICtrlSetState($button1, $GUI_ENABLE) ;恢复启用控件
						GUICtrlSetState($button2, $GUI_ENABLE)
						GUICtrlSetState($button3, $GUI_ENABLE)
						GUICtrlSetState($button4, $GUI_ENABLE)
						If $mac[$o] == StringTrimLeft($mac1[$i], 1) Then ;到这里可以获取第二部分信息的序号$o
							GUICtrlSetData($Label09, _mach($id[$o])[1]) ;获取id用于获取真实mac
;~ 						MsgBox(0,$id[$o],_mach($id[$o])[1])
							$dhcp = StringTrimLeft($dhcpserver[$o], 1) ;获取dhcp是否
							If Not $dhcp = "" Then
								GUICtrlSetData($Group22, "当前网卡IP为自动获取 ")
							Else
								GUICtrlSetData($Group22, "当前网卡IP为手动配置")
							EndIf
							;============================================================================================
							_GUICtrlIpAddress_ClearAddress($Input1) ;先把ip地址框清空
							_GUICtrlIpAddress_ClearAddress($Input2)
							_GUICtrlIpAddress_ClearAddress($Input3)
							_GUICtrlIpAddress_ClearAddress($Input4)
							_GUICtrlIpAddress_ClearAddress($Input5)
							_GUICtrlIpAddress_Set($Input4, StringTrimLeft($DNS1[$o], 1))
							_GUICtrlIpAddress_Set($Input5, StringTrimLeft($DNS2[$o], 1))
							;============================================================================================
							If $zhuangtai[$i] == "7" Then ;如果未连接(没插网线),就从注册表取值
								ToolTip("开始读取注册表")
								_GUICtrlIpAddress_Set($Input1, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "IPAddress"))
								_GUICtrlIpAddress_Set($Input2, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "SubnetMask"))
								_GUICtrlIpAddress_Set($Input3, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "DefaultGateway"))
								ToolTip("")
							Else ;否则就从wmi取值
								_GUICtrlIpAddress_Set($Input1, StringTrimLeft($IP[$o], 1))
								_GUICtrlIpAddress_Set($Input2, StringTrimLeft($MAST[$o], 1))
								_GUICtrlIpAddress_Set($Input3, StringTrimLeft($GATEWAY[$o], 1))
							EndIf
						EndIf
					EndIf
					;MsgBox(0,0,UBound($mac))
					;_ArrayDisplay($mac)

					If $zhuangtai[$i] = 7 Then ;当前网卡线路断开768
;~ 						ToolTip("当前网卡未连接,请检查网络线缆是否插好")
						GUICtrlSetData($xinxi, "当前网卡线路断开769")
;~ 						GUICtrlSetState($xinxi, $gui_show)
						GUICtrlSetColor($Label10, 0xFF0000) ;本地连接 红色
						GUICtrlSetColor($xinxi, 0xFF0000) ;
						
						GUICtrlSetState($button1, $GUI_DISABLE) ;影藏按钮
						GUICtrlSetState($button2, $GUI_DISABLE)
						GUICtrlSetState($button3, $GUI_DISABLE)
						GUICtrlSetState($button4, $GUI_DISABLE)
;~ Else
;~ 						ToolTip("")
					EndIf
				EndIf
			Next
		Next
	ElseIf $pan = 0 Then
		GUICtrlSetState($Group11, $GUI_FOCUS)
		GUICtrlSetState($Group11, $gui_show)
		$you = 0
		;
		GUICtrlSetState($xinxi, $gui_hide)
		If StringTrimLeft($mac1[0], 1) = "" Then
;~ 			yin()
			GUICtrlSetData($Label11, "  " & StringTrimLeft($mac1[0], 1))
			GUICtrlSetData($xinxi, "当前网卡被禁用793")
			GUICtrlSetState($button1, $GUI_DISABLE)
			GUICtrlSetState($button2, $GUI_DISABLE)
			GUICtrlSetState($button3, $GUI_DISABLE)
			GUICtrlSetState($button4, $GUI_DISABLE)
			GUICtrlSetData($Group22, "当前计算机配置信息")
			GUICtrlSetState($xinxi, $gui_show)
;~ 			GUICtrlSetImage($ico, "", 2)
		Else
			GUICtrlSetState($button1, $GUI_ENABLE)
			GUICtrlSetState($button2, $GUI_ENABLE)
			GUICtrlSetState($button3, $GUI_ENABLE)
			GUICtrlSetState($button4, $GUI_ENABLE)
			GUICtrlSetState($xinxi, $gui_hide)
			GUICtrlSetData($Label11, "  " & StringTrimLeft($mac1[0], 1))
;~ 			xian()
			GUICtrlSetData($Label10, "  " & $lianjie1[0])
			GUICtrlSetData($Label09, _mach($id[0])[1]) ;获取id用于获取真实mac
			$dhcp = StringTrimLeft($dhcpserver[0], 1)
			If Not $dhcp = "" Then
				GUICtrlSetData($Group22, "当前计算机配置信息 “DHCP” ")
			Else
				GUICtrlSetData($Group22, "当前计算机配置信息")
			EndIf
			If $zhuangtai[0] == "7" Then
;~ 				GUICtrlSetImage($ico, @TempDir & "\noline.ico", 2)
				GUICtrlSetData($Input6, $computer[0])
				_GUICtrlIpAddress_ClearAddress($Input1)
				_GUICtrlIpAddress_ClearAddress($Input2)
				_GUICtrlIpAddress_ClearAddress($Input3)
				_GUICtrlIpAddress_ClearAddress($Input4)
				_GUICtrlIpAddress_ClearAddress($Input5)
				_GUICtrlIpAddress_Set($Input1, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[0], "IPAddress"))
				_GUICtrlIpAddress_Set($Input2, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[0], "SubnetMask"))
				_GUICtrlIpAddress_Set($Input3, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[0], "DefaultGateway"))
				_GUICtrlIpAddress_Set($Input4, StringTrimLeft($DNS1[0], 1))
				_GUICtrlIpAddress_Set($Input5, StringTrimLeft($DNS2[0], 1))
			Else
;~ 				GUICtrlSetImage($ico, @TempDir & "\line.ico", 2)
				GUICtrlSetData($Input6, $computer[0])
				_GUICtrlIpAddress_ClearAddress($Input1)
				_GUICtrlIpAddress_ClearAddress($Input2)
				_GUICtrlIpAddress_ClearAddress($Input3)
				_GUICtrlIpAddress_ClearAddress($Input4)
				_GUICtrlIpAddress_ClearAddress($Input5)
				_GUICtrlIpAddress_Set($Input1, StringTrimLeft($IP[0], 1))
				_GUICtrlIpAddress_Set($Input2, StringTrimLeft($MAST[0], 1))
				_GUICtrlIpAddress_Set($Input3, StringTrimLeft($GATEWAY[0], 1))
				_GUICtrlIpAddress_Set($Input4, StringTrimLeft($DNS1[0], 1))
				_GUICtrlIpAddress_Set($Input5, StringTrimLeft($DNS2[0], 1))
			EndIf
		EndIf
	Else
		GUICtrlSetData($xinxi, "没有检测到网卡！")
		GUICtrlSetData($Group22, "当前计算机配置信息")
		GUICtrlSetState($xinxi, $gui_show)
		GUICtrlSetState($button1, $GUI_DISABLE) ;控件转换为灰色(不可用)状态
		GUICtrlSetState($button2, $GUI_DISABLE)
		GUICtrlSetState($button3, $GUI_DISABLE)
		GUICtrlSetState($button4, $GUI_DISABLE)
	EndIf
EndFunc   ;==>du

Func _duid() ;获取姓名和编号
	$tab1 = "nnet"
	$inc1 = "zsmac" ;字段名
	$zsmac = GUICtrlRead($Label09)
;~ 	$zsmac = "1C1B0D013AE7"
	$duxm = _EzMySql_GetTable2d("SELECT xm , bh  FROM " & $tab1 & " WHERE " & $inc1 & " = '" & $zsmac & "'  AND `new` = 9   ") ;传递一个二维数组，其中包含列名和已执行查询的数据
	If UBound($duxm) - 1 Then
;~ 		MsgBox(0,"",UBound($duxm),3)
;~ 	_ArrayDisplay($duxm, "查询表中符合 " & $inc1 & " = " & $linshi & " 的特定数据 以二维数组的形式显示")
		For $ii = 1 To UBound($duxm) - 1 ;列出符合条件的数据ID
			GUICtrlSetData($Input201, _jestr($duxm[$ii][0]))
			
			GUICtrlSetData($Input301, _jestr($duxm[$ii][1]))
		Next
	EndIf
EndFunc   ;==>_duid

Func _dhcp()
	
	;自动获取IP地址
	;MsgBox(0,0,StringStripWS(GUICtrlRead($Label11),1 ))
	If StringInStr(GUICtrlRead($Group22), "自动获取") = 0 Then
		GUICtrlSetData($Group22, "正在修改DHCP配置信息，请稍等。。。766")
		For $i = 0 To UBound($mac) - 1
			MsgBox(0, $mac[$i], $Label11)
			If $mac[$i] == StringStripWS(GUICtrlRead($Label11), 1) Then ;连接名称
				RegDelete('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "ipaddress")
				
			EndIf
		Next
		$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
		$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", 0x10 + 0x20)
		For $objItem In $colItems
			;"网卡名：" & $objItem.Description & "”" & @CRLF & _
			If @error Then ExitLoop
			If $objItem.MACAddress == StringStripWS(GUICtrlRead($Label11), 1) Then
				$objItem.EnableDHCP()
				$objItem.SetDNSServerSearchOrder()
			EndIf

		Next
		;;;;;;;;;;;;;;;;;;;;;;;  设置DHCP自动获取  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		;$objItem.EnableDHCP
		;$objItem.SetDNSServerSearchOrder()
		;$objItem.ReleaseDHCPLease
		;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		$objWMIService = ""
		$colItems = ""
		$objItem = ""
		$colItems = ""
		;	RunWait(@ComSpec & ' /c netsh interface ip set address "' & StringStripWS(GUICtrlRead($Label10), 1) & '" source=dhcp', "", @SW_HIDE)
		;	RunWait(@ComSpec & ' /c ipconfig /renew', "", @SW_HIDE)
		MsgBox(64 + 0, "提示", "DCHP自动获取IP设置成功")
		GUICtrlSetData($Group22, "正在刷新配置信息，请稍等。。。798")
		WMI()
		Sleep(5000)
		du()
	Else
		MsgBox(64 + 0, "提示", "当前已经是DCHP自动获取IP地址，无需再设置！", 5)
	EndIf


EndFunc   ;==>_dhcp
Func WMI()
	$sMesStr = ""
	$net = ""
	$oLocator = ObjCreate("WbemScripting.SWbemLocator")
	$oService = $oLocator.ConnectServer

	$oClassSet = $oService.ExecQuery("Select * From Win32_NetworkAdapter Where NetConnectionID IS NOT NULL")

	For $oClass In $oClassSet
		If @error Then ExitLoop
		$sMesStr = $sMesStr & "连接名：“" & $oClass.NetConnectionID() & "”" & @CRLF & _
				"网卡名: “" & $oClass.Name & "”" & @CRLF & _
				"Mac地址: “:" & $oClass.MACAddress & "”" & @CRLF & _
				"连接状态:“" & $oClass.NetConnectionStatus & "”" & @CRLF & @CRLF
;~ 								MsgBox(0,"",$sMesStr)
	Next

	;MsgBox(0, 0, $sMesStr)
	;_ClipBoard_SetData($sMesStr,$CF_TEXT)
	$oClassSet = ""
	$oClass = ""
	$oService = ""
	$oLocator = ""

	$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
	$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled != 0", "WQL", 0x10 + 0x20)
	For $objItem In $colItems
		;"网卡名：" & $objItem.Description & "”" & @CRLF & _
		If @error Then ExitLoop
		$net = $net & "ip地址: “:" & $objItem.IPAddress(0) & "”" & @CRLF & _
				"子网掩码: “:" & $objItem.IPSubnet(0) & "”" & @CRLF & _
				"默认网关: “:" & $objItem.DefaultIPGateway(0) & "”" & @CRLF & _
				"首选dns: “:" & $objItem.DNSServerSearchOrder(0) & "”" & @CRLF & _
				"备用dns: “:" & $objItem.DNSServerSearchOrder(1) & "”" & @CRLF & _
				"mac地址: “" & $objItem.MACAddress & "”" & @CRLF & _
				"网卡ID: “" & $objItem.SettingID & "”" & @CRLF & _
				"计算机名: “" & $objItem.DNSHostName & "”" & @CRLF & _
				"DHCP状态: “1" & $objItem.DHCPServer(0) & "”" & @CRLF & @CRLF
;~ 				MsgBox(0,"",$net)
	Next
	;;;;;;;;;;;;;;;;;;;;;;;  设置DHCP自动获取  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;$objItem.EnableDHCP
	;$objItem.SetDNSServerSearchOrder()
	;$objItem.ReleaseDHCPLease
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	$objWMIService = ""
	$colItems = ""
	$objItem = ""
	$colItems = ""
	$wangka1 = 0
	$lianjie1 = 0
	$mac1 = 0
	$zhuangtai = 0
	$IP = 0
	$MAST = 0
	$GATEWAY = 0
	$DNS1 = 0
	$DNS2 = 0
	$mac = 0
	$id = 0
	$computer = 0
	$wangka1 = StringRegExp($sMesStr, "(?<=网卡名: “)[^”]+", 3)
	$lianjie1 = StringRegExp($sMesStr, "(?<=连接名：“)[^”]+", 3)
	$mac1 = StringRegExp($sMesStr, "(?<=Mac地址: “)[^”]+", 3)
	$zhuangtai = StringRegExp($sMesStr, "(?<=连接状态:“)[^”]+", 3) ;0 为禁用   2为连接    7为未连接

	$IP = StringRegExp($net, "(?<=ip地址: “)[^”]+", 3)
	$MAST = StringRegExp($net, "(?<=子网掩码: “)[^”]+", 3)
	$GATEWAY = StringRegExp($net, "(?<=默认网关: “)[^”]+", 3)
	$DNS1 = StringRegExp($net, "(?<=首选dns: “)[^”]+", 3)
	$DNS2 = StringRegExp($net, "(?<=备用dns: “)[^”]+", 3)
	$mac = StringRegExp($net, "(?<=mac地址: “)[^”]+", 3)
	$id = StringRegExp($net, "(?<=网卡ID: “)[^”]+", 3)
	$computer = StringRegExp($net, "(?<=计算机名: “)[^”]+", 3)
	$dhcpserver = StringRegExp($net, "(?<=DHCP状态: “)[^”]+", 3)
	;MsgBox(0,0, $IPMAC)
	;	_ArrayDisplay($sMesStr)
;~ 	MsgBox(0,$id[0], $zhuangtai[4])
;~ 	 _ArrayDisplay($zhuangtai)
EndFunc   ;==>WMI
;------------------------------------------IP地址本地部分结束-------------------------------------------------------------------------

Func _add()
	ToolTip("正在检测网络")
;~ 	$gwip=_GetIPa ( )
	$gwip = "180.123.20.363"
	ToolTip("检测网络无异常,开始上传")
	$bdwk = GUICtrlRead($Input7) ;		char(50)		本地网卡
	$ljmc = GUICtrlRead($Label10) ;		char(50)		;连接名称
	$ljmc = _jstr($ljmc) ;		char(50)		;连接名称
	$macdz = GUICtrlRead($Label11) ;		char(17)		;mac地址
	$zsmac = GUICtrlRead($Label09) ;		char(12)		;真实mac地址
	$macdz = _jstr($macdz)
	$xm = _jastr(GUICtrlRead($Input201)) ;		char(30)		姓名
	$bh = GUICtrlRead($Input301) ;		char(10)		编号
	$ipdz = _GUICtrlIpAddress_Get($Input1) ;		char(15)		IP
	$zwym = _GUICtrlIpAddress_Get($Input2) ;		char(15)		子网掩码：
	$mrwg = _GUICtrlIpAddress_Get($Input3) ;		char(15)		默认网关：
	$name = @ComputerName ;		char(15)		计算机名称：
	$dnsa = _GUICtrlIpAddress_Get($Input4) ;		char(15)		DNS
	$dnsb = _GUICtrlIpAddress_Get($Input5) ;		char(15)		DNS

	
;~ 			 _hardread("Win32_Processor", "$object.Name", 99)
	$cpupn = _hardread("Win32_Processor", "$object.Name", 99) ;		cpu	varchar(100)
	$cpusn = _hardread("Win32_Processor", "$object.ProcessorId", 99) ;		cpuid	varchar(100)
	$ncrl = _hardread("Win32_PhysicalMemory", "$object.Capacity", 99) ;		内存容量	varchar(100)
	$ncpl = _hardread("Win32_PhysicalMemory", "$object.Speed", 99) ;		内存频率	varchar(100)
	$ncsn = _hardread("Win32_PhysicalMemory", "$object.SerialNumber", 99) ;		内存sn	varchar(100)
	$ncpn = _hardread("Win32_PhysicalMemory", "$object.PartNumber", 99) ;		内存型号	varchar(100)
	$dncs = _hardread("Win32_ComputerSystem", "$object.Manufacturer", 99) ;		电脑厂商	varchar(100)
	$dnpn = _hardread("Win32_ComputerSystem", "$object.Model", 99) ;		电脑型号	varchar(100)
	$biosrq = _hardread("Win32_BIOS", "$object.ReleaseDate", 99) ;		bios日期	varchar(100)
	$biossn = _hardread("Win32_BIOS", "$object.SerialNumber", 99) ;		bios序列号	varchar(100)
	$zbccwz = _hardread("Win32_PhysicalMemoryArray", "$object.Location", 99) ;		主板内存插槽位置	varchar(100)
	$zbcczs = _hardread("Win32_PhysicalMemoryArray", "$object.MemoryDevices", 99) ;		主板内存插槽总数	varchar(100)
	$zbzdrl = _hardread("Win32_PhysicalMemoryArray", "$object.MaxCapacity", 99) ;		主板内存最大容量	varchar(100)
	$zbcs = _hardread("Win32_BaseBoard", "$object.Manufacturer", 99) ;		主板厂商	varchar(100)
	$zbpn = _hardread("Win32_BaseBoard", "$object.Product", 99) ;		主板型号	varchar(100)
	$zbsn = _hardread("Win32_BaseBoard", "$object.SerialNumber", 99) ;		主板序列号	varchar(100)
	$jqpn = _hardread("Win32_ComputerSystemProduct", "$object.Name", 99) ;		机器型号	varchar(100)
	$jqsn = _hardread("Win32_ComputerSystemProduct", "$object.IdentifyingNumber", 99) ;		机器序列号	varchar(100)
	$jqcs = _hardread("Win32_ComputerSystemProduct", "$object.Vendor", 99) ;		机器厂商	varchar(100)
	$yprl = _hardread("Win32_DiskDrive", "$object.Size", 99) ;		硬盘大小	varchar(100)
	$yppn = _hardread("Win32_DiskDrive", "$object.Model", 99) ;	Win32_DiskDrive	yppn	$object.Model
	$yplx = _hardread("Win32_DiskDrive", "$object.MediaType", 99) ;		硬盘类型	varchar(100)

	$cpupn = _jastr($cpupn)
	$cpusn = _jastr($cpusn)
	$ncrl = _jastr($ncrl)
	$ncpl = _jastr($ncpl)
	$ncsn = _jastr($ncsn) ;	内存sn	varchar(100)
	$ncpn = _jastr($ncpn) ;		内存型号	varchar(100)
	$dncs = _jastr($dncs) ;		电脑厂商	varchar(100)
	$dnpn = _jastr($dnpn) ;		电脑型号	varchar(100)
	$biosrq = _jastr($biosrq) ;		bios日期	varchar(100)
	$biossn = _jastr($biossn) ;		bios序列号	varchar(100)
	$zbccwz = _jastr($zbccwz) ;		主板内存插槽位置	varchar(100)
	$zbcczs = _jastr($zbcczs) ;		主板内存插槽总数	varchar(100)
	$zbzdrl = _jastr($zbzdrl) ;		主板内存最大容量	varchar(100)
	$zbcs = _jastr($zbcs) ;		主板厂商	varchar(100)
	$zbpn = _jastr($zbpn) ;		主板型号	varchar(100)
	$zbsn = _jastr($zbsn) ;		主板序列号	varchar(100)
	$jqpn = _jastr($jqpn) ;		机器型号	varchar(100)
	$jqsn = _jastr($jqsn) ;		机器序列号	varchar(100)
	$jqcs = _jastr($jqcs) ;		机器厂商	varchar(100)
	$yprl = _jastr($yprl) ;		硬盘大小	varchar(100)
;~ 	$yppn =  _jastr($yppn) ;	Win32_DiskDrive	yppn	$object.Model
	$yplx = _jastr($yplx) ;		硬盘类型	varchar(100)
	
;~ 	MsgBox(0,$yppn,$yplx)

	$qidongkaiguan = 9
	If $qidongkaiguan = 9 Then ;#Region 写入数据库
		
		$y = "','"

		ToolTip("正在写入数据库.网卡(新)....")
		$q10 = "nnet" ;网卡(新)
		$q20 = "`( `bdwk` , `ljmc` , `macdz` , `ipdz` , `gwip` , `zwym` , `mrwg` , `name` , `dnsa` , `dnsb` , `xm` , `bh` , `bz1` , `bz2"
		$q20 = "`(`bdwk` , `ljmc` , `macdz` , `ipdz` , `gwip` , `zwym` , `mrwg` , `name` , `dnsa` , `dnsb` , `xm` , `bh` , `bz1` , `bz2"
		$q30 = "VALUES ( '" & $bdwk & $y & $ljmc & $y & $macdz & $y & $ipdz & $y & $gwip & $y & $zwym & $y & $mrwg & $y & $name & $y & $dnsa & $y & $dnsb & $y & $xm & $y & $bh & $y & $bz1 & $y & $bz2 & $y
		addsql($q10, $q20, $q30)

		ToolTip("正在写入数据库.硬件(新)....")
		$q10 = "nhard" ;硬件(新)
		$q20 = "`(`cpupn` , `cpusn` , `ncrl` , `ncpl` , `ncsn` , `ncpn` , `dncs` , `dnpn` , `biosrq` , `biossn` , `zbccwz` , `zbcczs` , `zbzdrl` , `zbcs` , `zbpn` , `zbsn` , `jqpn` , `jqsn` , `jqcs` , `yprl` , `yppn` , `yplx"
		$q30 = "VALUES ( '" & $cpupn & $y & $cpusn & $y & $ncrl & $y & $ncpl & $y & $ncsn & $y & $ncpn & $y & $dncs & $y & $dnpn & $y & $biosrq & $y & $biossn & $y & $zbccwz & $y & $zbcczs & $y & $zbzdrl & $y & $zbcs & $y & $zbpn & $y & $zbsn & $y & $jqpn & $y & $jqsn & $y & $jqcs & $y & $yprl & $y & $yppn & $y & $yplx & $y
		addsql($q10, $q20, $q30)
		
		ToolTip("正在写入数据库.文本(新)....")
		$q10 = "ntxt" ;文本(新)
		$q20 = "`(`text"
		$q30 = "VALUES ( '" & _StringToHex($text) & "' , '"
		addsql($q10, $q20, $q30)

		ToolTip("")
	EndIf ;控制代码
	$qidongkaiguan = 0
	ToolTip("上传完成")
EndFunc   ;==>_add

Func TEST1()
	$aaa = "0x1"
	$cc = _jastr($aaa)
;~ 		MsgBox(0, $aaa, $cc)
	$aaa = _jestr($cc)
;~ 		MsgBox(0,$cc , $aaa)
EndFunc   ;==>TEST1

Func _jstr($aaa) ;去除空白
	$bbb = _jastr($aaa)
	$bbb = StringStripWS($bbb, 8)
	Return $bbb
EndFunc   ;==>_jstr

Func _jastr($aaa) ;字符串加密
	If StringIsASCII($aaa) Then ;不需要加密
		$bbb = $aaa
		If StringLeft($aaa, 2) = "0x" Then $bbb = StringTrimLeft($aaa, 2) ;如果0x开头就去掉
	Else ;需要加密,有汉字
		$bbb = "0x" & _StringToHex($aaa)
	EndIf
	Return $bbb
EndFunc   ;==>_jastr

Func _jestr($aaa) ;字符串解密
	If StringLeft($aaa, 2) = "0x" Then
		$bbb = _HexToString($aaa)
	Else
		$bbb = $aaa
	EndIf
	Return $bbb
EndFunc   ;==>_jestr

Func _GetIP()
	$gipt = IniRead($f0 & "getip.ini", "mark", "time", "")
	$gip = IniRead($f0 & "getip.ini", "get", "ip", "")
	If $gipt = "" Or $gip = "" Then
		Run($f0 & "\t_ip.exe", $f0)
;~ MsgBox(0,$gip,$gipt)
	EndIf
	If $gip = "58.211.169.58" Then $title1 = $title0 & " ≡ 迅达专版"
	If $gip = "180.108.6.142" Then $title1 = $title0 & " ≡ 琴川街道办专版?"
	If $gip = "58.210.215.211" Then $title1 = $title0 & " ≡ 琴川街道办专版"
	If $gip = "117.80.86.80" Then $title1 = $title0 & " ≡ 迅达机房专用"
	If $gip = "124.70.190.234" Then $title1 = $title0 & " ≡ 华为云专版"

EndFunc   ;==>_GetIP
